package com.yuanqi.java.result;
import lombok.Getter;

/**
 * 审核结果枚举
 */
@Getter
public enum AuditResult {

    REJECTED(0, "驳回"),
    APPROVED(1, "通过");

    private final Integer code;
    private final String description;

    AuditResult(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static AuditResult getByCode(Integer code) {
        for (AuditResult result : values()) {
            if (result.getCode().equals(code)) {
                return result;
            }
        }
        return null;
    }
}
